package com.arofoxmsn.model.invitation;

import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;

import com.arofoxmsn.model.User;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class AbstractInvitation {
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id", unique = true, nullable = false)
	private double id;
	
	private String subject;
	
	private String message;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private User from;
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	private User to;
	
	private Calendar createdAt;
	
	@Column(name="invitation_state") 
	@Enumerated(EnumType.ORDINAL) 
	private InvitationStateType sate;
	
	
	public double getId() {return id;}
	public void setId(double id) {this.id = id;}
	
	public String getSubject() {return subject;}
	public void setSubject(String subject) {this.subject = subject;}
	
	public String getMessage() {return message;}
	public void setMessage(String message) {this.message = message;}
	
	public User getFrom() {return from;}
	public void setFrom(User from) {this.from = from;}
	
	public User getTo() {return to;}
	public void setTo(User to) {this.to = to;}
	
	public Calendar getCreatedAt() {return createdAt;}
	public void setCreatedAt(Calendar createdAt) {this.createdAt = createdAt;}
	
	public InvitationStateType getSate() {return sate;}
	public void setSate(InvitationStateType sate) {this.sate = sate;}
	
}
